package nav

/*
#include<stdint.h>
#include<stdbool.h>
extern void nav_rcIntArray_clear(void * c_this);
extern void nav_rcIntArray_Delete(void * c_this);
extern void nav_rcIntArray_DeleteArray(void * c_this);
extern void * nav_rcIntArray_IndexArray(void * c_this,long n);
extern int nav_rcIntArray_pop(void * c_this);
extern void nav_rcIntArray_push(void * c_this,int item);
extern void* nav_NewrcIntArray();
extern void* nav_NewrcIntArray11(int n);
extern void nav_rcIntArray_resize(void * c_this,int size);
extern int nav_rcIntArray_size(void * c_this);
extern void nav_rcNewTag_Delete(void * c_this);
extern void nav_rcNewTag_DeleteArray(void * c_this);
extern void * nav_rcNewTag_IndexArray(void * c_this,long n);
extern void* nav_NewrcNewTag();
extern void * nav_NewRcIntArrayPtrArray(long n);
extern void * nav_NewRcNewTagPtrArray(long n);
extern void * nav_rcAlloc(unsigned long long size,unsigned int hint);
extern void nav_rcFree(void * ptr);

*/
import "C"
import "unsafe"
import "gitee.com/hasika/cgo"

var _ unsafe.Pointer
var _ cgo.NotUsed

/*
Legacy class. Prefer rcVector
<int
>.
*/
type RcIntArrayPtr uintptr

/*
public void clear()
*/
func (p RcIntArrayPtr) Clear() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_rcIntArray_clear(wrap_this)
}

/*
public void Delete()
*/
func (p RcIntArrayPtr) Delete() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_rcIntArray_Delete(wrap_this)
}

/*
void DeleteArray()
*/
func (p RcIntArrayPtr) DeleteArray() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_rcIntArray_DeleteArray(wrap_this)
}

/*
rcIntArray * IndexArray(long n)
*/
func (p RcIntArrayPtr) IndexArray(n int) uintptr {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_rcIntArray_IndexArray(wrap_this, C.long(n))
	go_out := uintptr(wrap_out)
	return go_out
}

/*
public int pop()
*/
func (p RcIntArrayPtr) Pop() int32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_rcIntArray_pop(wrap_this)
	go_out := int32(wrap_out)
	return go_out
}

/*
public void push(int item)
*/
func (p RcIntArrayPtr) Push(item int32) {
	var wrap_this unsafe.Pointer
	var wrap_arg_item C.int
	wrap_this = unsafe.Pointer(p)
	wrap_arg_item = (C.int)(item)
	C.nav_rcIntArray_push(wrap_this, wrap_arg_item)
}

/*
public rcIntArray()
*/
func NewRcIntArray() cgo.GoManagedPtr[RcIntArrayPtr] {
	wrap_out := C.nav_NewrcIntArray()
	go_out := cgo.MakePtr[cgo.GoManagedPtr[RcIntArrayPtr]](uintptr(wrap_out))
	return go_out
}

/*
public rcIntArray(int n)
*/
func NewRcIntArray11(n int32) cgo.GoManagedPtr[RcIntArrayPtr] {
	var wrap_arg_n C.int
	wrap_arg_n = (C.int)(n)
	wrap_out := C.nav_NewrcIntArray11(wrap_arg_n)
	go_out := cgo.MakePtr[cgo.GoManagedPtr[RcIntArrayPtr]](uintptr(wrap_out))
	return go_out
}

/*
public void resize(int size)
*/
func (p RcIntArrayPtr) Resize(size int32) {
	var wrap_this unsafe.Pointer
	var wrap_arg_size C.int
	wrap_this = unsafe.Pointer(p)
	wrap_arg_size = (C.int)(size)
	C.nav_rcIntArray_resize(wrap_this, wrap_arg_size)
}

/*
public int size() const
*/
func (p RcIntArrayPtr) Size() int32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_rcIntArray_size(wrap_this)
	go_out := int32(wrap_out)
	return go_out
}

/*
An implementation of operator new usable for placement new. The default one is part of STL (which we don't use).
rcNewTag is a dummy type used to differentiate our operator from the STL one, in case users import both Recast
and STL.
*/
type RcNewTagPtr uintptr

/*
public void Delete()
*/
func (p RcNewTagPtr) Delete() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_rcNewTag_Delete(wrap_this)
}

/*
void DeleteArray()
*/
func (p RcNewTagPtr) DeleteArray() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_rcNewTag_DeleteArray(wrap_this)
}

/*
rcNewTag * IndexArray(long n)
*/
func (p RcNewTagPtr) IndexArray(n int) uintptr {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_rcNewTag_IndexArray(wrap_this, C.long(n))
	go_out := uintptr(wrap_out)
	return go_out
}

/*
public rcNewTag()
*/
func NewRcNewTag() cgo.GoManagedPtr[RcNewTagPtr] {
	wrap_out := C.nav_NewrcNewTag()
	go_out := cgo.MakePtr[cgo.GoManagedPtr[RcNewTagPtr]](uintptr(wrap_out))
	return go_out
}

/*
rcIntArray * NewRcIntArrayPtrArray(long n)
*/
func NewRcIntArrayPtrArray(n int) cgo.GoManagedPtr[cgo.Array[RcIntArrayPtr]] {
	wrap_out := C.nav_NewRcIntArrayPtrArray(C.long(n))
	go_out := cgo.MakePtr[cgo.GoManagedPtr[cgo.Array[RcIntArrayPtr]]](uintptr(wrap_out))
	return go_out
}

/*
rcNewTag * NewRcNewTagPtrArray(long n)
*/
func NewRcNewTagPtrArray(n int) cgo.GoManagedPtr[cgo.Array[RcNewTagPtr]] {
	wrap_out := C.nav_NewRcNewTagPtrArray(C.long(n))
	go_out := cgo.MakePtr[cgo.GoManagedPtr[cgo.Array[RcNewTagPtr]]](uintptr(wrap_out))
	return go_out
}

/*
Allocates a memory block.

@param size The size, in bytes of memory, to allocate.
@param hint A hint to the allocator on how long the memory is expected to be in use.
@return A pointer to the beginning of the allocated memory block, or null if the allocation failed.

@see rcFree, rcAllocSetCustom

void * rcAlloc(size_t size, rcAllocHint hint)
*/
func RcAlloc(size uint64, hint EnumRcAllocHint) uintptr {
	var wrap_arg_size C.ulonglong
	var wrap_arg_hint C.uint
	wrap_arg_size = (C.ulonglong)(size)
	wrap_arg_hint = (C.uint)(hint)
	wrap_out := C.nav_rcAlloc(wrap_arg_size, wrap_arg_hint)
	go_out := (uintptr)(unsafe.Pointer(wrap_out))
	return go_out
}

/*
Deallocates a memory block.  If @p ptr is NULL, this does nothing.

@warning This function leaves the value of @p ptr unchanged.  So it still
points to the same (now invalid) location, and not to null.

@param ptr A pointer to a memory block previously allocated using #rcAlloc.

@see rcAlloc, rcAllocSetCustom

void rcFree(void * ptr)
*/
func RcFree(ptr uintptr) {
	var wrap_arg_ptr unsafe.Pointer
	wrap_arg_ptr = (unsafe.Pointer)(ptr)
	C.nav_rcFree(wrap_arg_ptr)
}

/*
Provides hint values to the memory allocator on how long the
memory is expected to be used.
*/
type EnumRcAllocHint uint32

const (
	/*
	   Memory will persist after a function call.
	*/
	EnumRcAllocHint_RC_ALLOC_PERM EnumRcAllocHint = 0
	/*
	   Memory used temporarily within a function.
	*/
	EnumRcAllocHint_RC_ALLOC_TEMP EnumRcAllocHint = 1
)
